package com.shopoo.oauth.infrastructure.client.dto;

import java.io.Serializable;

import lombok.Data;

/**
 * @Description Oauth token信息
 * @Date 2020/5/26 11:21 上午
 * @Author <a href="mailto:android_li@sina.cn">Joe</a>
 **/
@Data
public class TokenResponse implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1823423287342078891L;

    private String access_token;

    private String token_type;

    private String refresh_token;

    private String userId;

    private String error;

    private String error_description;

    private Integer expires_in;

    private String scope;

    private String jti;

    public Oauth2TokenDTO toOauth2TokenDTO() {
        Oauth2TokenDTO oauth2TokenDTO = new Oauth2TokenDTO();
        oauth2TokenDTO.setAccessToken(this.getAccess_token());
        oauth2TokenDTO.setTokenType(this.getToken_type());
        oauth2TokenDTO.setRefreshToken(this.refresh_token);
        oauth2TokenDTO.setUserId(this.userId);
        oauth2TokenDTO.setError(this.error);
        oauth2TokenDTO.setErrorDescription(this.error_description);
        oauth2TokenDTO.setExpiresIn(this.expires_in);
        oauth2TokenDTO.setScope(this.scope);
        oauth2TokenDTO.setJti(this.jti);
        return oauth2TokenDTO;
    }

}
